Add Watchdog trait#13
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new Watchdog trait to the embedded-mcu-hal crate, providing an abstraction for feeding a processor's watchdog timer to prevent resets. It includes a blanket implementation for &mut T references.
Changes:
- Added a new
Watchdogtrait with an associatedErrortype and afeedmethod - Added a blanket impl of
Watchdogfor&mut TwhereT: Watchdog - Registered the new
watchdogmodule as a public module inlib.rs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
embedded-mcu-hal/src/watchdog.rs |
New file defining the Watchdog trait with a feed method and a blanket impl for &mut T |
embedded-mcu-hal/src/lib.rs |
Adds pub mod watchdog; to expose the new module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jerrysxie
left a comment
There was a problem hiding this comment.
@felipebalbi @williampMSFT Are we aligned on implementing this for MCXA and IMXRT?
I think so, yeah. There are a couple catches, though - we need to publish this crate to crates.io with semver versions, and we need to hide the implementation and linkage to embedded-mcu on the MCXA HAL behind a feature flag |
|
@gjpmsft @JamesHuard @bramsdell-ms @jamesmunns @diondokter Any feedback on this initial implementation of a MCU agnostic watchdog trait? |
This reverts commit 8dcd438.
This adds a trait to feed a watchdog timer